<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>index02-对象的简写包含属性和方法简写</title>
</head>
<body>
  <script type="text/javascript">
      let name = "张三";
      let age = 20;
      let gender = "男";

      let person = {
        // name: name,
        // age: age,
        // gender: gender,
        name, age, gender,
        // getInfo : function(){
        //   return "我的名字是:" + this.name + ",我的年龄是:" + this.age + ",我的性别是:" + this.gender;
        // }
        getInfo(){
          return "我的名字是:" + this.name + ",我的年龄是:" + this.age + ",我的性别是:" + this.gender;
        }
      };
      let result = person.getInfo();
      console.log(result)
  </script>
</body>
</html>